package com.lqjava.tuxiaowang.tuxiaowang.beans.result;

import java.util.ArrayList;
import java.util.List;

/**
 * Api统一响应格式
 * 返回list
 * @param <T> 实体
 * @author lq 2021年3月21日 18:35:33
 */
public class ListResultBean <T> {

	private boolean success;
	
	private String msg;
	
	private List<T> list = new ArrayList<>();

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}

	public void initTrue(List<T> list){
		this.success = true;
		this.msg = "successful";
		this.list = list;
	}
	
	public void initFalse(String msg){
		this.success = false;
		this.msg = msg;
	}
}
